<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑学生信息</title>
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/add.css' %}">
</head>
<body>
{% if student %}
<form action="{% url 'classmate:edit_info' student.id %}" method="post">
    {% csrf_token %}
    <p>姓名：<input type="text" name="name" value="{{ student.name }}"></p>
    <p>性别：<input type="text" name="gender" value="{{ student.gender }}"></p>
    <p>年龄：<input type="text" name="age" value="{{ student.age }}"></p>
    <p>班名：<select name="class_name_id" id="class_name">
        {% for n in classname%}
        <option value="{{n.id}}">{{n.name}}</option>
        {% endfor %}
    </select></p>
    <p>入学时间：<input type="datetime-local" name="study_time" value="{{ student.study_time |date:'Y-m-d\TH:i'}}"></p>
    <input type="submit" value="提交" class="btn">
</form>
{% else %}
<p>查无些人</p>
<a href="{% url 'classmate:index' %}" class="btn">返回</a>
{% endif %}
</body>
</html>